package com.foreknow.elmboot.mapper;


import com.foreknow.elmboot.po.Food;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface FoodMapper {
    /**
     * 根据businessId查询所属的食品信息
     * @param businessId
     * @return
     * @throws Exception
     */
    @Select("select * from food where businessId=#{businessId} order by foodId")
    public List<Food> listFoodByBusinessId(Integer businessId) throws Exception;


    /**
     * 根据foodid查询food信息
     * @param foodId
     * @return
     */
    @Select("select * from food where foodId=#{foodId}")
    public Food getFoodById(Integer foodId);
}
